import java.lang.invoke.LambdaConversionException;

public class test4 {
    public static void main1(String[] args) {
        Thread thread=new Thread(){
            public void run(){
                System.out.println("通过匿名内部类(Thread)实现");
            }
        };
        thread.start();
    }

    public static void main2(String[] args) {
        Thread thread=new Thread(new Runnable() {
            public void run() {
                System.out.println("通过匿名内部类(Runnable)实现");
            }
        });
        thread.start();
    }

    public static void main(String[] args) {
      Thread thread=new Thread(() ->{
          System.out.println("通过Lambda实现");
      });
      thread.start();
    }
}
